home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
U-Utilities
/
(c)u1.d64
/
copy files.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
3KB
|
109 lines
100 POKE55,0:POKE56,24:CLR
101 PG=24:MX=PEEK(56)
102 Z$=CHR$(0):Q$=CHR$(34)
103 POKE53280,15:POKE53281,1
104 PRINTCHR$(14);CHR$(8)
105 DIMF$(MX),F(MX),T(MX)
106 FORI=828TO904:READA:POKEI,A:NEXT
107 PRINT"[147][144][211][201][206][199][204][197] [196][201][211][203] [198][201][204][197] [195][207][208][201][197][210] ";
108 PRINT"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]";
109 PRINT"[208]LEASE INSERT THE [211][207][213][210][195][197][144] DISKETTE INTO"
110 PRINT"THE DISK DRIVE AND PRESS THE [210][197][212][213][210][206][146] KEY"
111 GETA$:IFA$<>CHR$(13)THEN111
112 OPEN15,8,15,"I0"
113 INPUT" [198]ILENAMES TO MATCH ? *[157][157][157]";F$
114 IFRIGHT$(F$,1)<>"*"THENF$=F$+"*"
115 GOSUB193:IFEGOTO189
116 OPEN1,8,0,"$0:"+F$:GOSUB193
117 IFETHENPRINT"[154] IMPOSSIBLE TO READ DIRECTORY [146]":GOTO189
118 PRINT" '[195][144]' TO COPY FILE '[210][144]' TO REJECT FILE ";
119 PRINT"'[194][144]' TO BEGIN COPY '[193][144]' TO ABORT COPY"
120 GET#1,A$,B$:N=0:AD=PG*256
121 GET#1,A$,B$:IFB$=""GOTO142
122 GET#1,A$,B$:F$=""
123 SZ=ASC(A$+Z$)+ASC(B$+Z$)*256
124 GET#1,A$:IF64ANDSTGOTO142
125 IFA$<>Q$GOTO124
126 GET#1,A$:IFA$<>Q$THENF$=F$+A$:GOTO126
127 GET#1,A$:IFA$<>" "GOTO127
128 GET#1,T$:IFT$=" "GOTO128
129 GET#1,A$:IFA$<>""GOTO129
130 IFSZ=0OR(T$<>"P"ANDT$<>"S")GOTO121
131 PRINTSZ;TAB(5);T$;" ";Q$;F$;Q$;TAB(26);
132 IFAD+SZ*256>53247THENPRINT"[212][207][207] [204][193][210][199][197][144]":GOTO121
133 PRINT"_ C:R:B:A?[146][157][157][157][157][157][157][157][157]";
134 GETA$:IFA$=""GOTO134
135 IFA$="R"THENPRINT"[154]REJECT FILE[144]":GOTO121
136 IFA$="B"THENPRINT"[154]BEGIN COPY[144]":GOTO142
137 IFA$="A"THENPRINT"[154]ABORT COPY[144]":GOTO186
138 IFA$<>"C"GOTO134
139 N=N+1:F$(N)=F$+","+T$:PRINT"[154]COPY FILE[144] "
140 AD=AD+SZ*256:IFN<MXGOTO121
141 PRINT" [205]AXIMUM OF";MX;"FILES."
142 CLOSE1:PRINT"";N;"FILES TO READ"
143 AD=PG*256:IFN=0GOTO189
144 FORI=1TON
145 PRINT" ";Q$;F$(I);Q$;TAB(20);
146 SZ=INT(AD/256)
147 POKE251,AD-SZ*256:POKE252,SZ
148 OPEN1,8,2,"0:"+F$(I):GOSUB193
149 IFE=74THENCLOSE1:N=I-1:GOTO157
150 IFETHENCLOSE1:F$(I)="":GOTO156
151 SYS831:GOSUB193:CLOSE1:IFE=74THENN=I-1:GOTO157
152 IFETHENF$(I)="":GOTO156
153 IFPEEK(252)=208THENF$(I)="":PRINT"[212][207][207] [204][193][210][199][197][146]":GOTO156
154 F(I)=AD:AD=PEEK(251)+PEEK(252)*256:T(I)=AD
155 PRINTRIGHT$(" "+STR$(T(I)-F(I)),5);" BYTES OF MEM"
156 NEXTI
157 IFN=0GOTO189
158 PRINT"[208]LEASE INSERT THE [196][197][211][212][201][206][193][212][201][207][206][144] DISKETTE"
159 INPUT"[198][207][210][205][193][212][144] THIS DISKETTE N[157][157][157]";A$
160 PRINT
161 IFA$<>"Y"GOTO165
162 INPUT" [196]ISK NAME,ID";F$,T$
163 PRINT#15,"N0:"+F$+","+T$
164 PRINT:GOSUB193:IFEGOTO157
165 FORI=1TON
166 IFF$(I)=""GOTO183
167 PRINT" ";Q$;F$(I);Q$;TAB(20);
168 OPEN1,8,2,F$(I)+",W"
169 GOSUB193:IFE=0GOTO176
170 CLOSE1:IFE=63THEN172
171 REM CLOSE1:IFE<>63GOTO840
172 PRINT:INPUT" [210][197][208][204][193][195][197][144] EXISTING FILE [157]? N[157][157][157]";A$
173 PRINT
174 IFA$<>"Y"GOTO183
175 PRINT#15,"S0:"+F$(I):GOTO167
176 SZ=INT(F(I)/256)
177 POKE251,F(I)-SZ*256:POKE252,SZ
178 SZ=INT(T(I)/256)
179 POKE253,T(I)-SZ*256:POKE254,SZ
180 SYS828:GOSUB193:CLOSE1:IFE=72ORE=74GOTO184
181 IFEGOTO183
182 PRINTRIGHT$(" "+STR$(T(I)-F(I)),5);" BYTES OF MEM"
183 NEXTI
184 INPUT" [211]AVE SAME PROGRAMS AGAIN? N[157][157][157]";A$
185 IFA$="Y"GOTO157
186 CLOSE15:CLOSE1
187 INPUT" [205]ORE PROGRAMS TO COPY? Y[157][157][157]";A$
188 IFA$="Y"THEN CLOSE15:CLOSE1:GOTO107
189 PRINTTAB(14)"[197][206][196] [207][198] [195][207][208][217]"
190 PRINTTAB(7)"[208]LEASE REMOVE THE DISKETTE"
191 PRINTTAB(11)"FROM THE DISK DRIVE[144]"
192 PRINTCHR$(9);:END
193 INPUT#15,E,E$,E1,E2
194 IFE=0THENRETURN
195 EE$=MID$(STR$(E),2):E1$=MID$(STR$(E1),2):E2$=MID$(STR$(E2),2)
196 IFE=63THENRETURN
197 PRINT:PRINT"";EE$;",";E$;",";E1$;",";E2$
198 DATA 76,96,3,162,1,32,198,255,32
199 DATA 228,255,160,0,145,251,230
200 DATA 251,208,8,230,252,165,252
201 DATA 201,208,240,6,165,144,41,64
202 DATA 240,231,76,204,255,162,1,32
203 DATA 201,255,162,54,134,1,160,0
204 DATA 177,251,32,210,255,230,251
205 DATA 208,2,230,252,165,251,197,253
206 DATA 208,239,165,252,197,254,208
207 DATA 233,162,55,134,1,76,204,255